<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>07_计算属性</title>
    <script src="../node_modules/vue/dist/vue.js"></script>
</head>
<body>
    <div id=app> 
    输入金额: <input type="text" v-model="total" />    
    <h2>{{msg}}</h2>
    </div>


    <script>
        const vm = new Vue({
            el:'#app',
            data:{
                total: 0
            },
            computed:{
                msg(){
                    return `您一共消费${this.total}元`;
                }
            }
        });
    </script>
</body>
</html>